package UVA;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Scanner;

/*
 * @Author Josh Lear
 * @Date 4/18/2014
 * @Problem simple io, mechanics
 */
public class UVA_12372 {
    public static void main (String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
                System.out));
        int cases = sc.nextInt();
        for (int i = 1; i <= cases; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            bw.write("Case " + i + ": ");
            if (a > 20 || b > 20 || c > 20) {
                bw.write("bad\n");
            } else {
                bw.write("good\n");
            }
        }
        bw.flush();
        sc.close();
    }
}
